package tt.dz.dao.ext.dic;

import java.util.List;

import org.springframework.stereotype.Repository;

import tt.dz.dao.base.BaseDao;
import tt.dz.entity.dic.OmsDicDistrictCode;

/**
 * 区县代码数据操作Dao
 * 
 * @author xielongfei
 * 
 */
@Repository
public class OmsDicDistrictCodeDao extends BaseDao<OmsDicDistrictCode> {

	/**
	 * 通过城市编码id查询区县代码列表
	 * @param city_code
	 * @return
	 */
	public List<OmsDicDistrictCode> findOmsDicDistrictCodeByCityCodeEmbedList(String city_code){
		
		//初始化查询对象
		OmsDicDistrictCode omsDicDistrictCode = new OmsDicDistrictCode();
		omsDicDistrictCode.setCity_code(city_code);
		
		return super.findExample(omsDicDistrictCode, null, null, null, null);
	}
	

	/**
	 * 区县代码ID查询区县详细
	 * @param district_code
	 * @return
	 */
	public OmsDicDistrictCode findOmsDicDistrictCodeByDistrictCode(String district_code){
		
		//初始化查询对象
		OmsDicDistrictCode omsDicDistrictCode = new OmsDicDistrictCode();
		omsDicDistrictCode.setDistrict_code(district_code);;
		
		List<OmsDicDistrictCode> dicDistrictCodes = super.findExample(omsDicDistrictCode, null, null, null, null);
		if(dicDistrictCodes!=null && dicDistrictCodes.size()>0){
			return dicDistrictCodes.get(0);
		}
		return null;
	}
	
}
